package com.swust.exam.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

import com.swust.exam.pojo.Question;
import com.swust.exam.pojo.Questionbank;
import com.swust.exam.service.QuestionService;
import com.swust.exam.service.QuestionbankService;

@RestController
public class QuestionController {
	@Autowired
	private QuestionService questionService;
	
	@GetMapping(value = "/question/get")
	public Question questionGet(int id)
	{
		return questionService.get(id);
	}
	
	
	@DeleteMapping(value="/question/delete")
	public int questionDelete(int id) {
		return questionService.delete(id);
	}
	
	@PostMapping(value="/question/insert")
	public int questionInsert(Question question) {
		return questionService.insert(question);
	}
	
	@PutMapping(value="/question/update")
	public int questionUpdate(Question question) {
		return questionService.update(question);
	}
		

}
